Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add aws assume role plugin #15294

Open
wants to merge 11 commits into
base: devel
Choose a base branch
from

Conversation

derekwaters
Copy link

SUMMARY

This change adds a new credential plugin that allows for the lookup of temporary AWS credentials using the AWS AssumeRole API. An AWS User Account may be configured either in the AssumeRole credential plugin (with an Access Key and Secret Key) or the default AWS API authentication may be used within the execution environment.

Prior to execution a job, the AWS AssumeRole API is called with the specified role name (ARN). If the authentication is successful, a temporary Access Key, Secret Key and Session Token are generated by AWS and used to populate a standard AWS Access Credential.

ISSUE TYPE
  • New or Enhanced Feature
COMPONENT NAME
  • API
AWX VERSION
awx: 0.1.dev34063+g5b9e03a
ADDITIONAL INFORMATION

AWS AssumeRole API information can be found here:

https://docs.aws.amazon.com/cli/latest/reference/sts/assume-role.html#output

Details of how this plugin works (from when it was implemented as a custom user-installed plugin) can be found here:

https://derekwaters.github.io/ansible/execution/environments/credentials/aws/sts/assume/role/2023/12/21/building-a-custom-credential-plugin.html

@fosterseth
Copy link
Member

@chadmf thoughts on pulling in this credential plugin?

@thedoubl3j
Copy link
Member

kicking CI

@chadmf
Copy link
Collaborator

chadmf commented Aug 1, 2024

LGTM!

Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linting fixes

awx/main/credential_plugins/aws_assumerole.py Outdated Show resolved Hide resolved
awx/main/credential_plugins/aws_assumerole.py Outdated Show resolved Hide resolved
awx/main/credential_plugins/aws_assumerole.py Outdated Show resolved Hide resolved
@github-actions github-actions bot added component:awx_collection issues related to the collection for controlling AWX component:ui dependencies Pull requests that update a dependency file and removed component:ui component:awx_collection issues related to the collection for controlling AWX dependencies Pull requests that update a dependency file labels Aug 2, 2024
@derekwaters
Copy link
Author

Now updated to pass unit tests properly, and adjusted for Sonarcloud scan. Sorry about the previous unit testing and linting failures, poor form on my part.

@thedoubl3j
Copy link
Member

re kicked CI @derekwaters and no worries.

Copy link
Member

@thedoubl3j thedoubl3j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rebased and waiting for CI to finish. thanks for the contribution @derekwaters

Copy link

sonarcloud bot commented Aug 28, 2024

@thedoubl3j
Copy link
Member

Also @derekwaters do note that this code will be affected by our new architecture work to move inv plugins and creds out of the AWX. A forum post can be found talking about it.

I didn't want to get into a state of you doing all of this work here and then us cutting things and this not be there, thus forcing you to recontribute already "done" work. Either myself or @chrismeyersfsu in #15476 will cut over the work to the new repo (https://github.com/ansible/awx-plugins) and make sure that commit history and authorship is preserved.

@derekwaters
Copy link
Author

Thanks @thedoubl3j I am aware of that move, I'm happy to rework if necessary in the new repo, but if this can go in before the refactor, then great.

@webknjaz
Copy link
Member

@derekwaters the corresponding code for other things is already in the other repo. So here it'll only be a removal and wiring up the dependency. That repo, though, is still in progress of integrating the migrated code with the dev/test infra. You can make a PR already but it'll be a minute until the infra becomes able to accept it.

@pratikkumar-mohite
Copy link

any update on this? still waiting for this feature.!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants